package com.lcf.framework.enums;

import lombok.Getter;

/**
 * 权限枚举
 *
 * @author lcf
 */
@Getter
public enum PermissionEnum {
    SYS_ANNOUNCEMENT_ADD(PermissionTypeEnum.SYS_ANNOUNCEMENT, "新增公告"),
    SYS_ANNOUNCEMENT_EDIT(PermissionTypeEnum.SYS_ANNOUNCEMENT, "修改公告"),
    SYS_ANNOUNCEMENT_DEL(PermissionTypeEnum.SYS_ANNOUNCEMENT, "删除公告"),
    SYS_ANNOUNCEMENT_PAGE(PermissionTypeEnum.SYS_ANNOUNCEMENT, "分页查询公告"),
    SYS_ANNOUNCEMENT_EDIT_STATUS(PermissionTypeEnum.SYS_ANNOUNCEMENT, "修改公告状态"),
    SYS_ANNOUNCEMENT_DETAIL(PermissionTypeEnum.SYS_ANNOUNCEMENT, "获取公告详情"),

    SYS_DICT_ADD(PermissionTypeEnum.SYS_DICT, "新增字典"),
    SYS_DICT_EDIT(PermissionTypeEnum.SYS_DICT, "修改字典"),
    SYS_DICT_DEL(PermissionTypeEnum.SYS_DICT, "删除字典"),
    SYS_DICT_EDIT_STATUS(PermissionTypeEnum.SYS_DICT, "字典停启用"),
    SYS_DICT_PAGE(PermissionTypeEnum.SYS_DICT, "分页查询字典"),
    SYS_DICT_DETAIL(PermissionTypeEnum.SYS_DICT, "字典详情"),

    SYS_DICT_TYPE_ADD(PermissionTypeEnum.SYS_DICT_TYPE, "新增字典类型"),
    SYS_DICT_TYPE_EDIT(PermissionTypeEnum.SYS_DICT_TYPE, "修改字典类型"),
    SYS_DICT_TYPE_DEL(PermissionTypeEnum.SYS_DICT_TYPE, "删除字典类型"),
    SYS_DICT_TYPE_PAGE(PermissionTypeEnum.SYS_DICT_TYPE, "分页查询字典类型"),
    SYS_DICT_TYPE_LIST(PermissionTypeEnum.SYS_DICT_TYPE, "获取字典类型列表"),
    SYS_DICT_TYPE_DETAIL(PermissionTypeEnum.SYS_DICT_TYPE, "字典类型详情"),

    SYS_MENU_ADD(PermissionTypeEnum.SYS_MENU, "新增菜单"),
    SYS_MENU_EDIT(PermissionTypeEnum.SYS_MENU, "修改菜单"),
    SYS_MENU_DEL(PermissionTypeEnum.SYS_MENU, "删除菜单"),
    SYS_MENU_TREE(PermissionTypeEnum.SYS_MENU, "获取菜单树"),
    SYS_MENU_DETAIL(PermissionTypeEnum.SYS_MENU, "获取菜单详情"),

    SYS_ROLE_ADD(PermissionTypeEnum.SYS_ROLE, "新增角色"),
    SYS_ROLE_EDIT(PermissionTypeEnum.SYS_ROLE, "修改角色"),
    SYS_ROLE_DEL(PermissionTypeEnum.SYS_ROLE, "删除角色"),
    SYS_ROLE_PAGE(PermissionTypeEnum.SYS_ROLE, "获取角色分页列表"),
    SYS_ROLE_LIST(PermissionTypeEnum.SYS_ROLE, "获取全部角色列表"),
    SYS_ROLE_DETAIL(PermissionTypeEnum.SYS_ROLE, "获取角色详情"),

    SYS_ROLE_MENU_SET(PermissionTypeEnum.SYS_ROLE_MENU, "设置角色菜单权限"),
    SYS_ROLE_MENU_LIST(PermissionTypeEnum.SYS_ROLE_MENU, "查看角色菜单列表"),

    SYS_TENANT_ADD(PermissionTypeEnum.SYS_TENANT, "新增租户"),
    SYS_TENANT_EDIT(PermissionTypeEnum.SYS_TENANT, "修改我的租户"),
    SYS_TENANT_PAGE(PermissionTypeEnum.SYS_TENANT, "查询租户分页列表"),
    SYS_TENANT_DETAIL(PermissionTypeEnum.SYS_TENANT, "查询租户详情"),

    SYS_TENANT_USER_ADD(PermissionTypeEnum.SYS_TENANT_USER, "租户添加用户"),
    SYS_TENANT_USER_KICK_OUT(PermissionTypeEnum.SYS_TENANT_USER, "将用户踢出当前租户"),
    SYS_TENANT_USER_PAGE(PermissionTypeEnum.SYS_TENANT_USER, "租户分页查询用户"),
    SYS_TENANT_USER_GET_DETAIL(PermissionTypeEnum.SYS_TENANT_USER, "查看租户下用户详情"),
    SYS_TENANT_USER_TENANT_LIST(PermissionTypeEnum.SYS_TENANT_USER, "查看用户加入的租户列表"),

    SYS_USER_ADD(PermissionTypeEnum.SYS_USER, "创建用户"),
    SYS_USER_PAGE(PermissionTypeEnum.SYS_USER, "分页查询用户"),
    SYS_USER_DETAIL(PermissionTypeEnum.SYS_USER, "查看用户详情"),

    SYS_USER_ROLE_SET(PermissionTypeEnum.SYS_USER_ROLE, "设置用户角色"),
    SYS_USER_ROLE_GET(PermissionTypeEnum.SYS_USER_ROLE, "获取用户角色"),

    SYS_PERMISSION_LIST(PermissionTypeEnum.SYS_PERMISSION, "获取全部权限列表");


    private final PermissionTypeEnum type;
    private final String name;

    PermissionEnum(PermissionTypeEnum type, String name) {
        this.type = type;
        this.name = name;
    }

    @Getter
    public enum PermissionTypeEnum {
        SYS_ANNOUNCEMENT("公告"),
        SYS_DICT("字典"),
        SYS_DICT_TYPE("字典类型"),
        SYS_MENU("菜单"),
        SYS_ROLE("角色"),
        SYS_TENANT("租户"),
        SYS_USER("用户"),
        SYS_PERMISSION("权限"),
        SYS_ROLE_MENU("角色菜单权限"),
        SYS_TENANT_USER("租户用户"),
        SYS_USER_ROLE("用户角色"),
        ;

        PermissionTypeEnum(String name) {
            this.name =name;
        }

        private final String name;
    }
}
